<!DOCTYPE html>












  


<html class="theme-next muse use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">








  <script>
  (function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/0f81ff2f.js","daovoice")
  daovoice('init', {
      app_id: "6db189de"
    });
  daovoice('update');
  </script>









  <link rel="apple-touch-icon" sizes="180x180" href="/images/logo.jpg?v=7.2.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/logo.jpg?v=7.2.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/logo.jpg?v=7.2.0">







<link rel="stylesheet" href="/css/main.css?v=7.2.0">






<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">


  
  
  <link rel="stylesheet" href="/lib/needsharebutton/needsharebutton.css">







<script id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    version: '7.2.0',
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":true},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":true},
    copycode: {"enable":false,"show_result":false,"style":null},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    search: {
      root: '/',
      path: 'search.xml'
    },
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    }
  };
</script>
<script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
<link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">
  <meta name="description" content="比赛时间：2019.8.7-2019.8.10">
<meta name="keywords" content="电子竞赛">
<meta property="og:type" content="article">
<meta property="og:title" content="2019电子竞赛准备和比赛过程记录">
<meta property="og:url" content="https://swhaledcc.github.io/2019/08/07/2019电子竞赛国赛/index.html">
<meta property="og:site_name" content="Dccun&#39;s Blog">
<meta property="og:description" content="比赛时间：2019.8.7-2019.8.10">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20190731104618602.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20190731171838583.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20190731200919478.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20190801155117333.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20190801155335678.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20190801155406628.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20190731203509372.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70">
<meta property="og:updated_time" content="2020-07-24T06:40:23.779Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="2019电子竞赛准备和比赛过程记录">
<meta name="twitter:description" content="比赛时间：2019.8.7-2019.8.10">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/20190731104618602.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70">



  <link rel="alternate" href="/atom.xml" title="Dccun's Blog" type="application/atom+xml">



  
  
  <link rel="canonical" href="https://swhaledcc.github.io/2019/08/07/2019电子竞赛国赛/">



<script>
    (function(){
        if(''){
            if (prompt('请输入查看密码') !== ''){
                alert('密码不正确,请询问主编大大！');
                history.back();
            }
        }
    })();
</script>
<script id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  
  <title>2019电子竞赛准备和比赛过程记录 | Dccun's Blog</title>
  












  <noscript>
  <style>
  .use-motion .motion-element,
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-title { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
	<a href="https://github.com/swhaleDCC/swhaleDCC.github.io" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewbox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; left: 0; transform: scale(-1, 1);" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"/><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"/><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"/></svg><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style></a>
    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Dccun's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
      
        <p class="site-subtitle">不烦世事，满心欢喜</p>
      
    
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
      
    

    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home                          //首页"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
      
    

    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive          //归档"></i> <br>归档</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">

    
    
      
    

    

    <a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th           //分类"></i> <br>分类</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
      
    

    

    <a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags                     //标签"></i> <br>标签</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-about">

    
    
      
    

    

    <a href="/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user                   //关于"></i> <br>关于</a>

  </li>

      
      
        <li class="menu-item menu-item-search">
          <a href="javascript:;" class="popup-trigger">
          
            <i class="menu-item-icon fa fa-search fa-fw"></i> <br>搜索</a>
        </li>
      
    </ul>
  

  
    

  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
      

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://swhaledcc.github.io/2019/08/07/2019电子竞赛国赛/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Dccun">
      <meta itemprop="description" content="你是我心上百褶，是人间惊鸿客">
      <meta itemprop="image" content="/images/dcc.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Dccun's Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">2019电子竞赛准备和比赛过程记录

              
            
          </h1>
        

        <div class="post-meta">
        	


          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-08-07 20:20:00" itemprop="dateCreated datePublished" datetime="2019-08-07T20:20:00+08:00">2019-08-07</time>
            </span>
          

          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/电子竞赛/" itemprop="url" rel="index"><span itemprop="name">电子竞赛</span></a></span>

                
                
              
            </span>
          

          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
                 阅读次数： 
                <span class="busuanzi-value" id="busuanzi_value_page_pv"></span>
              </span>
            </span>
          

          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <blockquote>
<p>比赛时间：2019.8.7-2019.8.10</p>
</blockquote>
<a id="more"></a>



<h2 id="7月31日"><a href="#7月31日" class="headerlink" title="7月31日"></a>7月31日</h2><p>（没有时间仔细写笔记，只做简单记录，仅供自己比赛使用）</p>
<h3 id="复习PID算法"><a href="#复习PID算法" class="headerlink" title="复习PID算法"></a>复习PID算法</h3><p>五月份的时候练习2017年国赛滚球系统已经了解过PID算法，但是并不熟练，比赛前还是有必要再进一步熟悉PID算法的。<br><a href="https://blog.csdn.net/qq_40631927/article/details/90109991" target="_blank" rel="noopener">滚球经验总结</a></p>
<h3 id="摄像头openmv"><a href="#摄像头openmv" class="headerlink" title="摄像头openmv"></a>摄像头openmv</h3><p>17年国赛控制题滚球系统用到了摄像头的图像处理，老师预测19年还会用到图像处理，因此我们选择了openmv。跟ov系列摄像头比起来，openmv实在是太好用了，不用再拘泥于C，可以使用python。上面滚球经验总结里面也有写openmv跟stm32f407战舰版通信方法。<br>openmv主要就是在<a href="https://book.openmv.cc/video/" target="_blank" rel="noopener">官网</a>学习的。</p>
<blockquote>
<p>接线方式：<br>openmv——407核心板<br>P4————RX（PA10_USART1）<br>P5————TX（PA9_USART1）<br>GND———GND</p>
</blockquote>
<p><img src="https://img-blog.csdnimg.cn/20190731104618602.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<h3 id="MPU6050六轴传感器"><a href="#MPU6050六轴传感器" class="headerlink" title="MPU6050六轴传感器"></a>MPU6050六轴传感器</h3><p>MPU6050 采用 IIC 与 STM32F4 通信。<br>姿态数据，也就是欧拉角——航向角（yaw）、横滚角（roll）、俯仰角（pitch）。<br>MPU6050 自带了数字运动处理器，即 DMP。<br>检测轴及方向：<br><img src="https://img-blog.csdnimg.cn/20190731171838583.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br> MPU6050 与探索者 STM32F4 开发板的连接：<br><img src="https://img-blog.csdnimg.cn/20190731200919478.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<h2 id="8月1日"><a href="#8月1日" class="headerlink" title="8月1日"></a>8月1日</h2><p>今天台风登陆小岛~一直到上午十点多才来电，中午出了器材清单，开始猜题。<br><img src="https://img-blog.csdnimg.cn/20190801155117333.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img src="https://img-blog.csdnimg.cn/20190801155335678.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><img src="https://img-blog.csdnimg.cn/20190801155406628.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<h2 id="8月2日"><a href="#8月2日" class="headerlink" title="8月2日"></a>8月2日</h2><p>今天一天就是看网上各种猜题，淘宝找做控制类的器材，报给学校一份，自己买了一份备用（主要因为学校买的各种不靠谱）。</p>
<h2 id="8月3日"><a href="#8月3日" class="headerlink" title="8月3日"></a>8月3日</h2><h3 id="SD卡的使用"><a href="#SD卡的使用" class="headerlink" title="SD卡的使用"></a>SD卡的使用</h3><h4 id="openmv——SD卡"><a href="#openmv——SD卡" class="headerlink" title="openmv——SD卡"></a>openmv——SD卡</h4><p>先插SD卡再上电<br>SD卡的文件系统会自动取代内置的Flash文件系统<br>openmv使用SD卡的情况：</p>
<ol>
<li>代码行数太多</li>
<li>存储图片</li>
<li>录制视频</li>
</ol>
<h4 id="stm32——SD卡"><a href="#stm32——SD卡" class="headerlink" title="stm32——SD卡"></a>stm32——SD卡</h4><p>只运行了stm32自带的例程，并不懂SD卡怎么用。。。</p>
<h3 id="通信"><a href="#通信" class="headerlink" title="通信"></a>通信</h3><p>通信很重要，当初做滚球，openmv和stm32通信传输小球坐标时费了很大劲，通信还是要好好看看。</p>
<h4 id="蓝牙模块"><a href="#蓝牙模块" class="headerlink" title="蓝牙模块"></a>蓝牙模块</h4><p>HC-05   <a href="https://blog.csdn.net/qq_38410730/article/details/80368485" target="_blank" rel="noopener">参考博客</a><br>主要想实现的功能是手机蓝牙控制STM32——<br>手机通过蓝牙传输到HC-05上，再通过串口通信和STM32通信。<br>我们组在网上买了一个组装好的小车，手机APP通过蓝牙HC06控制，蓝牙名称BT04，密码1234。<br>测试APP：蓝牙模块通过stlink连接电脑，用串口调试助手观察按下APP的按键时接收的信息。<br><a href="https://appstore.huawei.com/app/C100166101" target="_blank" rel="noopener">蓝牙串口APP</a></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br></pre></td><td class="code"><pre><span class="line">#include &quot;stm32f10x.h&quot;</span><br><span class="line"> </span><br><span class="line"> void My_USART1_Init(void)  </span><br><span class="line">&#123;  </span><br><span class="line">    GPIO_InitTypeDef GPIO_InitStrue;  </span><br><span class="line">    USART_InitTypeDef USART_InitStrue;  </span><br><span class="line">    NVIC_InitTypeDef NVIC_InitStrue;  </span><br><span class="line">      </span><br><span class="line">    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);//GPIO端口使能  </span><br><span class="line">    RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1,ENABLE);//串口端口使能  </span><br><span class="line">      </span><br><span class="line">    GPIO_InitStrue.GPIO_Mode=GPIO_Mode_AF_PP;  </span><br><span class="line">    GPIO_InitStrue.GPIO_Pin=GPIO_Pin_9;  </span><br><span class="line">    GPIO_InitStrue.GPIO_Speed=GPIO_Speed_10MHz;  </span><br><span class="line">    GPIO_Init(GPIOA,&amp;GPIO_InitStrue);  </span><br><span class="line">      </span><br><span class="line">    GPIO_InitStrue.GPIO_Mode=GPIO_Mode_IN_FLOATING;  </span><br><span class="line">    GPIO_InitStrue.GPIO_Pin=GPIO_Pin_10;  </span><br><span class="line">    GPIO_InitStrue.GPIO_Speed=GPIO_Speed_10MHz;  </span><br><span class="line">    GPIO_Init(GPIOA,&amp;GPIO_InitStrue);  </span><br><span class="line">      </span><br><span class="line">    USART_InitStrue.USART_BaudRate=115200;  </span><br><span class="line">    USART_InitStrue.USART_HardwareFlowControl=USART_HardwareFlowControl_None;  </span><br><span class="line">    USART_InitStrue.USART_Mode=USART_Mode_Tx|USART_Mode_Rx;  </span><br><span class="line">    USART_InitStrue.USART_Parity=USART_Parity_No;  </span><br><span class="line">    USART_InitStrue.USART_StopBits=USART_StopBits_1;  </span><br><span class="line">    USART_InitStrue.USART_WordLength=USART_WordLength_8b;  </span><br><span class="line">      </span><br><span class="line">    USART_Init(USART1,&amp;USART_InitStrue);</span><br><span class="line">      </span><br><span class="line">    USART_Cmd(USART1,ENABLE);//使能串口1  </span><br><span class="line">      </span><br><span class="line">    USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);//开启接收中断  </span><br><span class="line">      </span><br><span class="line">    NVIC_InitStrue.NVIC_IRQChannel=USART1_IRQn;  </span><br><span class="line">    NVIC_InitStrue.NVIC_IRQChannelCmd=ENABLE;  </span><br><span class="line">    NVIC_InitStrue.NVIC_IRQChannelPreemptionPriority=1;  </span><br><span class="line">    NVIC_InitStrue.NVIC_IRQChannelSubPriority=1;  </span><br><span class="line">    NVIC_Init(&amp;NVIC_InitStrue);  </span><br><span class="line">      </span><br><span class="line">&#125;  </span><br><span class="line">  </span><br><span class="line">void USART1_IRQHandler(void)  </span><br><span class="line">&#123;  </span><br><span class="line">    u8 res;  </span><br><span class="line">     if(USART_GetITStatus(USART1,USART_IT_RXNE)!=RESET)  </span><br><span class="line"> &#123;  </span><br><span class="line">     res= USART_ReceiveData(USART1); 	 </span><br><span class="line">     USART_SendData(USART1,res);     </span><br><span class="line">  &#125;  </span><br><span class="line">&#125;  </span><br><span class="line">   </span><br><span class="line"> int main(void)  </span><br><span class="line"> &#123;    </span><br><span class="line">	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);  </span><br><span class="line">    My_USART1_Init();  </span><br><span class="line">     while(1);  </span><br><span class="line">       </span><br><span class="line"> &#125;</span><br></pre></td></tr></table></figure>

<h4 id="WiFi模块ESP8266"><a href="#WiFi模块ESP8266" class="headerlink" title="WiFi模块ESP8266"></a>WiFi模块ESP8266</h4><blockquote>
<p>VCC连接正极(有些是3.3V,有些是5V)<br>GND连接负极<br>RXD:数据的接收端 (连接单片机或者USB转TTL模块的TXD)<br>TXD:数据的发送端 (连接单片机或者USB转TTL模块的RXD)</p>
</blockquote>
<p><a href="https://blog.csdn.net/ljh_1999/article/details/95028436" target="_blank" rel="noopener">参考博客</a></p>
<h4 id="NRF24L01无线模块"><a href="#NRF24L01无线模块" class="headerlink" title="NRF24L01无线模块"></a>NRF24L01无线模块</h4><p> NRF24L01是SPI 通信接口。<br> 主要想实现的功能是——两个开发板通信，如果做图像处理，有时候一块开发板不够用，就需要两块开发板。<br>开发板上 NRF24L01 模块接口和 STM32F4的连接：<br><img src="https://img-blog.csdnimg.cn/20190731203509372.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNjMxOTI3,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<h2 id="8月4日"><a href="#8月4日" class="headerlink" title="8月4日"></a>8月4日</h2><p>学校负责老师突然让学生自己买器材，离比赛只剩两天半时间，服气。</p>
<h3 id="云台"><a href="#云台" class="headerlink" title="云台"></a>云台</h3><p>在网上买了几个二维云台，用2个舵机控制。</p>
<h2 id="比赛"><a href="#比赛" class="headerlink" title="比赛"></a>比赛</h2><p>A题无线充电小车是去年省赛的题目，没想到会连续出两年，完全没准备，放弃。<br>B题是巡线四旋翼，难，放弃。<br>F题纸张计数，学校仪器设备不够，放弃。<br>最后选了H题，电磁炮，正好用到了之前做滚球时的舵机和openmv。<br>由于H题只要能成功发射电磁炮就能得十分，所以选这个人的题特别特别多，测评结束后我们学校获奖的六个组其中五个组是做电磁炮。<br>只捡几个点写一下吧，毕竟最后只拿了省二<del>~</del>结果不尽人意，大神太多</p>
<ol>
<li>电磁炮的炮管放在二维云台上控制电磁炮水平垂直运动，通过控制继电器高低电平控制充电时间，通过控制舵机旋转控制炮管角度，进而控制炮弹发射距离和方向。</li>
<li>按键模块使用的是手机APP，通过蓝牙模块HC-05向开发板（stm32F407核心板）传输发射距离和角度。</li>
<li>发挥部分的自动寻靶和测距用的是openmv，这些都能在openmv官网找到代码，openmv找到靶子并且测得距离后通过串口发送给开发板，继而控制舵机，然后发射炮弹。</li>
</ol>

      
    </div>

    

    
      
    

    
    
    
    <div>
  
    <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">---------------------------- 本 文 结 束  <i class="fa fa-paw"></i>  感 谢 阅 读 ----------------------------</div>
    
</div>
  
</div>

    

    
      
    

    
      <div>
        <div id="reward-container">
  <div>欢迎打赏~</div>
  <button id="reward-button" disable="enable" onclick="var qr = document.getElementById(&quot;qr&quot;); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">

    
      
      
        
      
      <div style="display: inline-block">
        <img src="/images/wechat.png" alt="Dccun 微信支付">
        <p>微信支付</p>
      </div>
    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        
          
        
        <div class="post-tags">
          
            <a href="/tags/电子竞赛/" rel="tag"><i class="fa fa-tag"></i> 电子竞赛</a>
          
        </div>
      

      
      
        <div class="post-widgets">
        

        

        
          
          <div class="social_share">
            
            
              <div id="needsharebutton-postbottom">
                <span class="btn">
                  <i class="fa fa-share-alt" aria-hidden="true"></i>
                </span>
              </div>
            
          </div>
        
        </div>
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2019/05/30/Linux/" rel="next" title="Linux命令入门学习笔记">
                <i class="fa fa-chevron-left"></i> Linux命令入门学习笔记
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/09/22/机器学习/" rel="prev" title="[加密文章]机器学习深度学习笔记">
                [加密文章]机器学习深度学习笔记 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>

  </div>


          </div>
          
  
    
    
  <div class="comments" id="comments">
    <div id="lv-container" data-id="city" data-uid="MTAyMC80NjM5MC8yMjkwMQ=="></div>
  </div>
  
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-overview">

          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  
    <img class="site-author-image" itemprop="image" src="/images/dcc.jpg" alt="Dccun">
  
  <p class="site-author-name" itemprop="name">Dccun</p>
  <div class="site-description motion-element" itemprop="description">你是我心上百褶，是人间惊鸿客</div>
</div>


  <nav class="site-state motion-element">
    
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">31</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-categories">
        
          
            <a href="/categories/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">11</span>
        <span class="site-state-item-name">分类</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-tags">
        
          
            <a href="/tags/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">27</span>
        <span class="site-state-item-name">标签</span>
        </a>
      </div>
    
  </nav>



  <div class="feed-link motion-element">
    <a href="/atom.xml" rel="alternate">
      <i class="fa fa-rss"></i>RSS
    </a>
  </div>





  <div class="links-of-author motion-element">
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="https://github.com/swhaleDCC" title="GitHub &rarr; https://github.com/swhaleDCC" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="https://www.weibo.com/5986829280/profile?topnav=1&wvr=6" title="weibo &rarr; https://www.weibo.com/5986829280/profile?topnav=1&wvr=6" rel="noopener" target="_blank"><i class="fa fa-fw fa-weibo"></i>weibo</a>
      </span>
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="https://blog.csdn.net/qq_40631927" title="csdn &rarr; https://blog.csdn.net/qq_40631927" rel="noopener" target="_blank"><i class="fa fa-fw fa-crosshairs"></i>csdn</a>
      </span>
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="https://www.jianshu.com/u/e048aac8c8a0" title="简书 &rarr; https://www.jianshu.com/u/e048aac8c8a0" rel="noopener" target="_blank"><i class="fa fa-fw fa-heartbeat"></i>简书</a>
      </span>
    
  </div>






  <div class="links-of-blogroll motion-element links-of-blogroll-inline">
    <div class="links-of-blogroll-title">
      <i class="fa  fa-fw fa-link"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
      
        <li class="links-of-blogroll-item">
          <a href="https://www.zhihu.com/people/zhe-yan-56-43/activities" title="https://www.zhihu.com/people/zhe-yan-56-43/activities" rel="noopener" target="_blank">知乎</a>
        </li>
      
        <li class="links-of-blogroll-item">
          <a href="https://zhuanlan.zhihu.com/p/32957389" title="https://zhuanlan.zhihu.com/p/32957389" rel="noopener" target="_blank">github+hexo搭建个人博客</a>
        </li>
      
        <li class="links-of-blogroll-item">
          <a href="https://www.jianshu.com/p/1f8107a8778c" title="https://www.jianshu.com/p/1f8107a8778c" rel="noopener" target="_blank">next主题优化</a>
        </li>
      
        <li class="links-of-blogroll-item">
          <a href="https://lab.github.com/" title="https://lab.github.com/" rel="noopener" target="_blank">GitHub Learning Lab</a>
        </li>
      
    </ul>
  </div>


          
          
        </div>
      </div>

      
      <!--noindex-->
        <div class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
            
            
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#7月31日"><span class="nav-text">7月31日</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#复习PID算法"><span class="nav-text">复习PID算法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#摄像头openmv"><span class="nav-text">摄像头openmv</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#MPU6050六轴传感器"><span class="nav-text">MPU6050六轴传感器</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8月1日"><span class="nav-text">8月1日</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8月2日"><span class="nav-text">8月2日</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8月3日"><span class="nav-text">8月3日</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#SD卡的使用"><span class="nav-text">SD卡的使用</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#openmv——SD卡"><span class="nav-text">openmv——SD卡</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#stm32——SD卡"><span class="nav-text">stm32——SD卡</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#通信"><span class="nav-text">通信</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#蓝牙模块"><span class="nav-text">蓝牙模块</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#WiFi模块ESP8266"><span class="nav-text">WiFi模块ESP8266</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#NRF24L01无线模块"><span class="nav-text">NRF24L01无线模块</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8月4日"><span class="nav-text">8月4日</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#云台"><span class="nav-text">云台</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#比赛"><span class="nav-text">比赛</span></a></li></ol></div>
            

          </div>
        </div>
      <!--/noindex-->
      

      

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2019 – <span itemprop="copyrightYear">2022</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Dccun</span>

  

  
</div>
<!--

  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v3.9.0</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> v7.2.0</div>


-->

<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共32.9k字</span>
</div>
        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="post-meta-item-icon">
      <i class="fa fa-user"></i>
    </span>
    <span class="site-uv" title="总访客量">
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
    </span>
  

  
    <span class="post-meta-divider">|</span>
  

  
    <span class="post-meta-item-icon">
      <i class="fa fa-eye"></i>
    </span>
    <span class="site-pv" title="总访问量">
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
    </span>
  
</div>









        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

    
  
  
  <script src="/lib/needsharebutton/needsharebutton.js"></script>
  <script>
    
      pbOptions = {};
      
        pbOptions.iconStyle = "box";
      
        pbOptions.boxForm = "horizontal";
      
        pbOptions.position = "bottomCenter";
      
        pbOptions.networks = "Weibo,Wechat,Douban,QQZone,Twitter,Facebook";
      
      new needShareButton('#needsharebutton-postbottom', pbOptions);
    
    
  </script>


    

  </div>

  

<script>
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
















  
  



  
    
    
  
  <script color="0,0,255" opacity="0.5" zindex="-1" count="99" src="/lib/canvas-nest/canvas-nest.min.js"></script>







  
  <script src="/lib/jquery/index.js?v=3.4.1"></script>

  
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>




  <script src="/js/utils.js?v=7.2.0"></script>

  <script src="/js/motion.js?v=7.2.0"></script>



  
  


  <script src="/js/schemes/muse.js?v=7.2.0"></script>



  
  <script src="/js/scrollspy.js?v=7.2.0"></script>
<script src="/js/post-details.js?v=7.2.0"></script>



  <script src="/js/next-boot.js?v=7.2.0"></script>

  

  

  


  













  <script src="/js/local-search.js?v=7.2.0"></script>



















  
    



<script>
  window.livereOptions = {
    refer: '2019/08/07/2019电子竞赛国赛/'
  };
  (function(d, s) {
    var j, e = d.getElementsByTagName(s)[0];
    if (typeof LivereTower === 'function') { return; }
    j = d.createElement(s);
    j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
    j.async = true;
    e.parentNode.insertBefore(j, e);
  })(document, 'script');
</script>


  
  <script type="text/javascript" src="/js/src/love.js"></script>
  <script type="text/javascript" src="/js/src/particle.js"></script>
  
 
	

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","model":{"jsonPath":"live2d-widget-model-wanko"},"display":{"position":"right","width":150,"height":300},"mobile":{"show":true},"log":false,"tagMode":false});</script></body>
</html>
